
//方法2 给 li 加 遍历所有li 

function fun(item, i) {
    item.onmousemove = function (evt) {
        var e = evt || window.event
        var boxObj = document.querySelector('.box')
        var w = boxObj.clientWidth
        var h = boxObj.clientHeight
        boxObj.style.display = 'block'
        //定位，然后把left、top改成鼠标位置
        boxObj.style.left = e.clientX - w / 2 + 'px'
        boxObj.style.top = e.clientY - h / 2 - 25 + 'px'
    }

    item.onmouseout = function () {
        var boxObj = document.querySelector('.box')
        boxObj.style.display = 'none'
    }
}

